import { defineConfig } from 'vite';
import { resolve } from 'path';
import uni from '@dcloudio/vite-plugin-uni';
import UnoCSS from 'unocss/vite';
import { config } from './src/config/env';

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: config.port,
  },
  resolve: {
    alias: { '@': resolve(__dirname, '/src') },
  },
  plugins: [uni(), UnoCSS()],
  css: {
    preprocessorOptions: {
      scss: {
        api: 'modern-compiler', // or 'modern'
        silenceDeprecations: ['legacy-js-api'],
      },
    },
  },
});
